package cn.leaf.web.config;

import cn.leaf.common.factory.YamlPropertySourceFactory;
import cn.leaf.web.handler.BaseExceptionHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 *
 * description: 统一异常处理配置
 *
 * @author twinkle leaf
 * @version v1.0.0
 * @since 2021-11-07 10:38:19
 * slogan: There are no two identical leaves in the world.
 *
 */
@Configuration
@ComponentScan(value="cn.leaf.web.handler")
@PropertySource(factory = YamlPropertySourceFactory.class, value = "classpath:leaf-error.yml")
public class ExceptionConfiguration {

    @Bean
    public BaseExceptionHandler baseExceptionHandler(){
        return new BaseExceptionHandler();
    }
}